home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / gnu / progutil / stdwin.zoo / conf / mkdep < prev    next >
Text File  |  1989-10-17  |  532b  |  23 lines

  1. #! /bin/sh
  2. # Shell script to create dependency lines for inclusion in a Makefile.
  3. # This is done by pulling each file through the C preprocessor,
  4. # filtering all '# <file> 1' lines out and doing some substitutions
  5. # on them.  Since the format of these lines may be different on your
  6. # system, you may have to modify the sed command below.
  7.  
  8. ARGS=
  9. while :
  10. do
  11.     case $1 in
  12.     -*)    ARGS="$ARGS $1"; shift;;
  13.     *)    break;;
  14.     esac
  15. done
  16.  
  17. for file
  18. do
  19.     obj=`basename $file .c`.o
  20.     cc $ARGS -E $file |
  21.     sed -n '/^# 1 "\(.*\)".*$/s//'$obj': \1/p'
  22. done
  23.